using System.Collections.Generic;
using com.tc.util;
using  com.tc.zigbee.zcl;
using  com.tc.zigbee.entity;
using  com.tc.zigbee.zcl.command;
namespace com.tc.zigbee.mt.income
{
    public class IeeeResponse : IncomeMessage
    {
        public IeeeResponse(byte[] data)
        {
            status = data[0];
            ieeeAddress = new byte[8];
            for (int i = 0; i < 8; i++)
                ieeeAddress[i] = data[i + 1];
            byte[] na = new byte[2];
            na[0] = data[9];
            na[1] = data[10];
            nwkAddress = DataUtil.shortValue(na);
            startIndex = data[11];
            assocLength = data[12];
            for (int i = 0; i < assocLength; i++)
            {
                na[0] = data[13 + i * 2];
                na[1] = data[13 + i * 2 + 1];
                assocDevices.Add(DataUtil.shortValue(na));

            }

        }
        byte status;
        byte[] ieeeAddress;
        short nwkAddress;
        byte startIndex;
        byte assocLength;
        public byte[] getIeeeAddress()
        {
            return ieeeAddress;
        }
        public byte getStatus()
        {
            return status;
        }
        public short getNwkAddress()
        {
            return nwkAddress;
        }
        public byte getStartIndex()
        {
            return startIndex;
        }
        public List<short> getAssocDevices()
        {
            return assocDevices;
        }
        List<short> assocDevices = new List<short>();
    }
}
